package se.perhamrin.judo.persistance;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import se.perhamrin.judo.domain.UjkMember;

class MemberRowMapper implements RowMapper<UjkMember> {

	public static final String NAME = "name";
	public static final String UJK_MEMBER_NUMBER = "ujk_member_number";
	public static final String IO_NUMBER = "idrott_online_number";

	public UjkMember mapRow(ResultSet rs, int rowNum) throws SQLException {
		return UjkMember.create(rs.getInt(UJK_MEMBER_NUMBER),
				rs.getLong(IO_NUMBER), rs.getString(NAME));
	}

	public static MemberRowMapper create() {
		return new MemberRowMapper();
	}

}